/* 
* File:   Logger.cpp
* Author: Ben Wolsieffer
* 
* Created on April 29, 2013, 5:35 PM
*/

#include "Logger.h"
#include "SystemIOLogger.h"
#include <string>
using namespace logger;

Logger::Logger() {
}

Logger::Logger(const Logger& orig) {
}

Logger::~Logger() {
}

void Logger::setLogger(Logger &logger) {
	instance = &logger;
}

Logger& Logger::getLogger() {
	return *instance;
}

void Logger::log(std::wstring &msg){
	log(Info(&msg));
}

void log(const ILoggable &msg) {
	Logger::getLogger().log(msg);
}

Logger *Logger::instance = new SystemIOLogger();

Logger::Info::Info(std::wstring *message): mMessage(message){
}

Logger::Info::Info(const Info &orig): mMessage(new std::wstring(*orig.mMessage)){
}

Logger::Info::~Info(){
	//delete mMessage;
}

void Logger::Info::log(std::wostream& stream) const {
    stream << *mMessage << std::endl;
}

int Logger::Info::getLevel() const {
	return 0;
}
